package com.br4mmie.asciistory.battle;

import java.util.ArrayList;

import com.br4mmie.asciistory.mission.Item;


/**
 * @author Niels
 * Battle reward, this is passed at the conclusion of a battle and contains the rewards
 * content is: dropped items, Experience points and the names of the beaten monsters
 */
public class BattleReward 
{	
	private ArrayList<Item>	loot;//dropped items
	private ArrayList<String> monsterNames;//names of the defeated monsters
	private int exp;//amount of xp earned
	private int gold;
	private String rewardText;
	/**
	 * Constructor
	 * @param spoils Items gained from this battle
	 * @param xp Experience gained from this battle
	 * @param kills names of the enemies killed in this battle
	 */
	BattleReward(ArrayList<Item> spoils, int xp, int gp, ArrayList<String> kills)
	{
		loot = spoils;
		exp = xp;
		monsterNames = kills;
		gold = gp;
	}
	public ArrayList<String> getMonsterNames() 
	{
		return monsterNames;
	}
	public void setMonsterNames(ArrayList<String> monsterNames) 
	{
		this.monsterNames = monsterNames;
	}
	public ArrayList<Item> getLoot() 
	{
		return loot;
	}
	public void setLoot(ArrayList<Item> loot) 
	{
		this.loot = loot;
	}
	public int getExp() 
	{
		return exp;
	}
	public int getGold()
	{
		return gold;
	}
	public void setExp(int exp) 
	{
		this.exp = exp;
	}
	public String toString()
	{
		String tempString = "Monsters:\n";
		for(String s : monsterNames)
		{
			tempString += s + '~';
		}
		if(!loot.isEmpty()){
			tempString += "\nLoot:\n";
			for(Item i : loot)
			{
				tempString += i.getName()+'~';
			}
		}
		tempString += "\nXP: " + exp;
		tempString += "\nGold: " + gold;
		return tempString;
	}
}
